package com.irs.pojo;

import lombok.ToString;

import javax.validation.constraints.Pattern;
@ToString
public class Goods {
    private int id;
    @Pattern(regexp="(^[a-zA-Z0-9_-]{6,16}$)|(^[\u2E80-\u9FFF]{2,5})"
            ,message="用户名必须是2-5位中文或者6-16位英文和数字的组合")
   private String goodsname;
    @Pattern(regexp="^[0-9]*$",
            message="物品编码必须式数字")
    private String goodcode;

    @Pattern(regexp="(^[1-9]\\d*(\\.\\d{1,2})?$)|(^0(\\.\\d{1,2})?$)",
            message="价格必须是数字")
    private String goodprice ;
    private String goodstock ;

    public int getId() {
        return id;
    }

    public String getGoodsname() {
        return goodsname;
    }

    public String getGoodcode() {
        return goodcode;
    }

    public String getGoodprice() {
        return goodprice;
    }

    public String getGoodstock() {
        return goodstock;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setGoodsname(String goodsname) {
        this.goodsname = goodsname;
    }

    public void setGoodcode(String goodcode) {
        this.goodcode = goodcode;
    }

    public void setGoodprice(String goodprice) {
        this.goodprice = goodprice;
    }

    public void setGoodstock(String goodstock) {
        this.goodstock = goodstock;
    }
}
